Computer Vision Basics with openCV

Import statements

Check your openCV version

Computer Vision Basics

Load and Image

Hint

Check the image type

Hint

Hint

Show the image using openCV

Hint

Now lets display unsing matplotlib

Lets fix the colors

Hint

What is the shape of the image?

Lets make it grayscale

What is the shape now?

How does it look like?

We need to indicate the colormap

Cropping an image

To edit an image making a copy of it is always a good idea!

Hint

Annotating images

Rectangles

Hint

Adding text to images

Hint

Now that you know how to load annotate and save images lets start manually annotating some images

Mini Projects

With all that you accomplished to do above you are now ready to do your first mini project!, you might need to learn some more new things to accomplish some of the harder levels below, it is very important to get used to the openCV docs

Meme creator

Level 1

  1. Create a basic Meme creator with one image and a short line of text, using any openCV font

Level 2

  1. Use the classic meme font (impact)

Level 3

  1. Improve it by adding 2 to 3 lines with the text on the top of the image and the bottom of the image
  2. Make the text in white and with black contours

Level 4

  1. Make the text center automatically Hint
  2. If the text is too long it should wrap the text in as many lines as needed

QR Reader

Level 1

  1. Researn on the openCV docs and learn about QRCodeDetector
  2. Grab any QR code from google images for example this one: or any other.
  3. Detect the code using QRCodeDetector
  4. Print QR detected if a QR has been detected in the image

Level 2

  1. Decode and print the decoded text
  2. Draw a rectangle around the QR code that has been detected and show it on screen
  3. Save the QR region of the image to disk